package com.ruoyi.bussine.service.integration;

import com.ruoyi.bussine.domain.dto.wechat.miniPay.WechatPayReqDTO;
import com.wechat.pay.java.core.notification.RequestParam;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import com.wechat.pay.java.service.payments.model.Transaction;
import com.wechat.pay.java.service.refund.model.CreateRequest;
import com.wechat.pay.java.service.refund.model.Refund;

/**
 * @author zhengyz
 * @date 2025/3/21
 */
public interface WeChatPayService {

    /**
     * 发起小程序预支付
     */
    PrepayWithRequestPaymentResponse initMiniProgramPay(WechatPayReqDTO wechatPayReqDTO);

    /**
     * 根据微信支付单号查询支付结果
     * wxPayNo 微信支付单号
     */
    Transaction queryPayResult(String wxPayNo);

    String closeOrder(String orderNo);

    /**
     * 根据订单号查询支付结果
     *
     * @param orderNo
     * @return
     */
    Transaction queryPayResultByOrderNo(String orderNo);

    /**
     * 应答微信回调，系统已经收到通知，并且解密报文
     *
     * @param requestParam
     * @return
     */
    Transaction callbackReply(RequestParam requestParam);

    Refund refund(CreateRequest refundRequest);

    Refund refundQuery(String refundNo);

}
